package com.uniledger.exchange.mine.scheme;

import android.os.AsyncTask;
import android.os.Bundle;

import com.uniledger.exchange.R;
import com.uniledger.exchange.base.activity.BaseActivity;
import com.uniledger.exchange.mine.scheme.keystore.StellarKeystore;
import com.uniledger.exchange.mine.scheme.keystore.WalletData;

public class KeyStoreActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_key_store);
    }

    @Override
    public void initBar() {
        super.initBar();
        toolbar.setTitle("Key Store");
    }

    @Override
    public void getParams() {
        new AsyncTask<String, Integer, String>() {
            @Override
            protected String doInBackground(String... strings) {
                StellarKeystore stellarKeystore = new StellarKeystore();
//                WalletData walletData = stellarKeystore.create("123456", null);
//                stellarKeystore.keypair(walletData, "123456");

                stellarKeystore.keypair("{\"address\":\"GCSO7H5TS53OMW5E3RG64FR77VBKMTFCWYTCM7DVGALALKWH43XSHI6Z\",\"crypto\":{\"ciphertext\":\"JUwNWBaXQAuClHBCzOst3HKpjJcl1qC3+sdCBs37ursUzy8Gq2HNrOOLfH9+uumwx5zUQ/lP1iaoy/YnbElaHFwNQ1wl3Kpl\",\"nonce\":\"118H58ItRMlx82FF+yAp+DHW/iA/GZb1\",\"salt\":\"3yT8PkIIaJ0BzljLCkNWKIQuH75U+UW22DjSV6hN1QM\\u003d\",\"scryptOptions\":{\"N\":16384,\"dkLen\":32,\"encoding\":\"binary\",\"p\":1,\"r\":8}},\"version\":\"stellarport-1-20-2018\"}", "123456");
                return null;
            }
        }.execute("");

    }
}
